
a = [1,2,3,5]
it = iter(a)
for _ in  range(len(a)):
    print(next(it))

class MyNumber:
    def __iter__(self):
        self.a = 1
        return self

    def __next__(self):
        x = self.a
        self.a +=1
        return x

myclass = MyNumber()
myiter = iter(myclass)
for _ in range(5):
    print(next(myiter))
